<?php

use think\migration\Migrator;
use think\migration\db\Column;

class UserMessages extends Migrator
{
    public function up()
    {
        $users = $this->table('messages', array('comment' => '短消息'));
        $users->addColumn('title', 'string', array('comment' => '消息标题'))
              ->addColumn('content', 'string', array('comment' => '消息内容'))
              ->addColumn('sender', 'uuid', array('comment' => '发件人'))
              ->addColumn('send_time', 'timestamp', array('default' => 'CURRENT_TIMESTAMP', 'comment' => '发送时间'))
              ->save();     
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable('messages');
    }
}
